﻿namespace Sidvall.Business
{
    public class BusinessSettings
    {
        #region Public Members

        public BusinessEvents EnabledBusinessEvents { get; set; }

        #region Copy

        public BusinessSettings Copy()
        {
            var item = new BusinessSettings();
            item.Import(this);
            return item;
        }

        #endregion
        #region Import

        public void Import(BusinessSettings item)
        {
            if (item == null)
                return;
            this.EnabledBusinessEvents = item.EnabledBusinessEvents;
        }

        #endregion
        #region ToString

        public override string ToString()
        {
            return this.EnabledBusinessEvents.ToString();
        }

        #endregion

        #endregion
        #region Factory Members

        public static BusinessSettings CreateSettings(BusinessEvents enabledEvents)
        {
            return new BusinessSettings()
            {
                EnabledBusinessEvents = enabledEvents,
            };
        }
        public static BusinessSettings CreateSettingsAll()
        {
            return new BusinessSettings()
            {
                EnabledBusinessEvents = BusinessEvents.All,
            };
        }
        public static BusinessSettings CreateSettingsNone()
        {
            return new BusinessSettings()
            {
                EnabledBusinessEvents = BusinessEvents.None,
            };
        }

        #endregion
    }
}
